package fr.cephb.joperon.core.entities;
import java.awt.Color;

import com.sleepycat.db.DatabaseEntry;
import com.sleepycat.db.DatabaseException;
import fr.cephb.joperon.core.entities.base.BaseCytMap;



/**
 * CytMap
 * Description: Feature map ID (15-digit string).
 */
public class CytMap
	extends BaseCytMap
	{
	/**
         *
         * Constructor
         *
         */
	public CytMap()
		{
		super();
		}


        /**
         *
         * Copy Constructor
         *
         */
		public CytMap(BaseCytMap cp)
			{
			super(cp);
			}
		
		/**
		 * constructor from a database entry
		 *
		 */
		public CytMap(DatabaseEntry entry) throws DatabaseException
			{
			super(entry);
			}
		

		
        /**
         *
         * clone
         *
         */
		public Object clone()
			{
			return new CytMap(this);
			}
		
		/**
		 * 
		 * @return a color for this cytoband as RGB
		 */
		public Color getColor()
			{
			  int r,g,b;
			  if (getStain().equals("gneg"))
			    {
			    r = g = b = 220;
			    }
			else if (getStain().equals ("gpos"))
			    {
			    r= g = b= 150;
			    }
			else if (getStain().startsWith("gvar"))
			    {
			    r = 180;
			    g = 180;
			    b = 120;
			    }
			else
			    {
			    r = 150;
			    g = 50;
			    b = 50;
			    }
			return new Color(r,g,b);
			}

		
		}

